package com.xinchuang.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinchuang.domain.pojo.TestNoticeTime;
import com.xinchuang.domain.pojo.TestNoticeTimeTable;
import org.apache.ibatis.annotations.*;

import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zx
 * @since 2023-07-04
 */
@Mapper
public interface TestNoticeTimeMapper extends BaseMapper<TestNoticeTime> {

    /**
     *
     * @param noteId
     * @param status
     * @return
     */
    @Select(value = {
            "SELECT IFNULL(SUM(intervals),0) FROM test_notice_time WHERE parent_notice_id = #{noteId} AND `status` = #{status}"
    })
    long getSumTime(
            String noteId, int status
    );

}
